package com.lazy.book.common.annotation;


import com.lazy.book.common.vaild.NotZeroValidator;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 *
 * @author lazy
 * @since 2025-09-05
 */
@Target({ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = NotZeroValidator.class)
public @interface NotZero {

  String message() default "Value must be non-null and non-zero";

  Class<?>[] groups() default {};

  Class<? extends Payload>[] payload() default {};
}

